package com.infoauto.opc.gateway.service.impl;
import com.infoauto.opc.gateway.dao.MonthlyOutputDao;
import com.infoauto.opc.gateway.model.gtm4.MonthlyOutput;
import com.infoauto.opc.gateway.model.gtm4.MonthlyOutputExport;
import com.infoauto.opc.gateway.model.gtm4.MonthlyTotal;
import com.infoauto.opc.gateway.service.MonthlyOutputService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 月度统计产量
 */
@Service
public class MonthlyOutputServiceImpl implements MonthlyOutputService {
    @Autowired
    private MonthlyOutputDao dao;
    @Override
    public int insert(MonthlyOutput monthlyOutput) {
        return dao.insert(monthlyOutput);
    }
    @Override
    public int update(MonthlyOutput monthlyOutput) {
        return dao.update(monthlyOutput);
    }
    @Override
    //根据plc地址和生产时间、班次唯一确定一条生产数据
    public MonthlyOutput selectPlcAdrrAndProductionTime(String plcAdrr,Integer shift) {
        return dao.selectPlcAdrrAndProductionTime(plcAdrr,shift);
    }

    @Override
    /**
     * 上曲线图按日期查询
     */
    public List<MonthlyOutput> selectList(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectList(groupName,projectName,startTime,endTime);
    }

    @Override
    /**
     * 上曲线图按月份查询
     */
    public List<MonthlyOutput> selectListByMonth(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectListByMonth(groupName,projectName,startTime,endTime);
    }

    @Override
    /**
     * 下曲线图按日期查询
     */
    public List<MonthlyOutput> selectList1(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectList1(groupName,projectName,startTime,endTime);
    }

    @Override
    /**
     * 下曲线图按月份查询
     */
    public List<MonthlyOutput> selectListByMonth1(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectListByMonth1(groupName,projectName,startTime,endTime);
    }

    @Override
    /**
     * 上曲线按日期查询累计值
     */
    public List<MonthlyTotal> selectTotalByday(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectTotalByday(groupName,projectName,startTime,endTime);
    }

    @Override
    /**
     * 上曲线按月份查询累计值
     */
    public List<MonthlyTotal> selectTotalMonth(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectTotalMonth(groupName,projectName,startTime,endTime);
    }

    @Override
    /**
     * 下曲线图按日期统计累计产量
     */
    public List<MonthlyTotal> selectTotalByday1(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectTotalByday1(groupName,projectName,startTime,endTime);
    }

    @Override
    /**
     * 下曲线图按月份统计累计产量
     */
    public List<MonthlyTotal> selectTotalMonth1(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectTotalMonth1(groupName,projectName,startTime,endTime);
    }

    @Override
    public List<MonthlyOutputExport> selectExportData(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectExportData(groupName,projectName,startTime,endTime);
    }

    @Override
    public List<MonthlyOutputExport> selectExportData1(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectExportData1(groupName,projectName,startTime,endTime);
    }

    @Override
    public List<MonthlyOutputExport> selectExportDataForMonth(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectExportDataForMonth(groupName,projectName,startTime,endTime);
    }

    @Override
    public List<MonthlyOutputExport> selectExportDataForMonth1(String groupName, String projectName, String startTime, String endTime) {
        return dao.selectExportDataForMonth1(groupName,projectName,startTime,endTime);
    }
}
